package com.bohua.Car.admin.controller;

import com.bohua.Car.admin.common.Lay;
import com.bohua.Car.admin.common.Msg;
import com.bohua.Car.admin.common.Pie;
import com.bohua.Car.admin.entity.Checktableg;
import com.bohua.Car.admin.service.ChenckService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/Chenck")
public class ChenckController {

    @Resource
    private ChenckService chenckService;

    @RequestMapping
    public String Chenck(){return "Chenck/Chenck.html" ;};

    @RequestMapping("/ChenckBar")
    public String ChenckBar(){return "Chenck/ChenckBar.html";};

    @RequestMapping("/Update")
    public String UpdateChenck(){ return "Chenck/updeteChenck.html";};


    @RequestMapping("/updete")
    @ResponseBody
    public Msg updeteChenck(Checktableg checktableg){
      return  chenckService.updeteChenck(checktableg);
    };

    @RequestMapping("/getAll")
    @ResponseBody
    public Lay ChenckType(Checktableg checktableg,Integer page,Integer limit){
        return chenckService.getAll(checktableg,page,limit);
    }

    @RequestMapping("/chenckban")
    @ResponseBody
    public List<Pie> bar(){return chenckService.ChenckBar();}
}
